﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace Domain.Entity
{
    [Serializable]
    public class Staff
    {
        public virtual long ID
        {
            get;
            set;
        }
        public virtual Title Title
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "First name")]
        public virtual string FirstName
        {
            get;
            set;
        }


        [Display(Name = "Last name")]
        public virtual string LastName
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "Address Line1")]
        public virtual string AddressLine1
        {
            get;
            set;
        }

        [Display(Name = "Address Line2")]
        public virtual string AddressLine2
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "City")]
        public virtual string City
        {
            get;
            set;
        }
        public virtual string County
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "Country")]
        public virtual Country Country
        {
            get;
            set;
        }

        [Required]
        [Display(Name = "Postcode")]
        public virtual string Postcode
        {
            get;
            set;
        }

        [RegularExpression(@"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$",
            ErrorMessage = "Please enter a valid e-mail adress")]
        [Required]
        [DataType(DataType.EmailAddress)]
        [Remote("EmailAvailable", "Staff", AdditionalFields = "InitialEmail")]
        public virtual string Email
        {
            get;
            set;
        }

        public virtual string InitialEmail
        {
            get;
            set;
        }

         [Display(Name = "Home Phone")]
        public virtual string HomePhone
        {
            get;
            set;
        }
         [Display(Name = "Mobile No")]
        public virtual string MobileNo
        {
            get;
            set;
        }
        public virtual DateTime CreatedDate
        {
            get;
            set;
        }
        public virtual int CreatedBy
        {
            get;
            set;
        }
        public virtual DateTime? UpdatedDate
        {
            get;
            set;
        }
        public virtual int? UpdatedBy
        {
            get;
            set;
        }
        public virtual bool IsDeleted
        {
            get;
            set;
        }
    }
}
